﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace Projet_WPF.Model
{
    class Live : ServiceLive.IServiceLiveCallback, IObserver<double>
    {
        private double _heart;
        private double _temperature;

        public double Temperature
        {
            get { return _temperature; }
            set { _temperature = value; }
        }

        public double Heart
        {
            get { return _heart; }
            set { _heart = value; }
        }

        public void PushDataHeart(double requestData)
        {
            Heart = requestData;
        }

        public void PushDataTemp(double requestData)
        {
            Temperature = requestData;
        }

        public void OnCompleted()
        {
            Debug.WriteLine("Finished");
        }

        public void OnError(Exception error)
        {
            throw new Exception(error.Message);
        }

        public void OnNext(double value)
        {
            Debug.WriteLine("{0}", value);
        }
    }
}
